<template>
  <div>
    <el-row>
      <el-col :span="16">
        <el-row  v-for="(o, index) in comments" key="o">
          <el-col :span="24">
            <el-card style="width: 820px; ">
              <el-row>
                <el-col :span="2">
                  <el-avatar :size="size" :src="o.userPhoto"></el-avatar>
                </el-col>
                <el-col :span="18">
                  <el-row>
                    <span style="font-size: 15px;">{{ o.userName }}</span>
                  </el-row>
                  <el-row>
                    <el-rate v-model="o.resultScore" disabled></el-rate>
                  </el-row>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="22" :offset="2">
                  <span style="font-size: 12px;">{{ o.content }}</span>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="22" :offset="2" style="margin-top: 5px;">
                  <el-image v-for="imgUrl in o.urls"
                        style="width: 100px; height: 100px; margin-right: 10px;"
                        :src="imgUrl"
                        :fit="fit">
                  </el-image>
                </el-col>
              </el-row>
              <el-row v-if="o.replay && o.replay !== ''">

                <el-col :span="22" :offset="2">
                  <el-divider></el-divider>
                  <span style="12px">商家回复：{{o.replay}}</span>
                </el-col>
              </el-row>
            </el-card>
          </el-col>
        </el-row>
      </el-col>
      <el-col :span="6" style="margin-left: 40px; margin-top: 20px;">

      </el-col >
    </el-row>
  </div>
</template>

<script>
  export default {
    name: 'U_comment',
    data() {
      return {
        // score: "5",
        // userscore:"4",
        comments:[
        ],
        storeReply:{},
        circleUrl: "https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png",
        url:"https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"
      }
    },
    mounted(){
      this.getComments();
    },
    created(){
    },
    methods: {
      reply(){
        this.$http.post("/commentInfo/replay").then(resp=>{

        })
      },
      getComments() {
        this.$http.get("/commentInfo/search",{
          params:{
            storeId: this.$route.query.id
          }
        }).then(resp => {
          if (resp.data.code == 200) {
            this.comments = resp.data.data;
          }
        })
      }
    }
  }
</script>

<style>
</style>
